package cn.etynit.mms.feign;

import cn.etynit.mms.fallback.ActivityServiceFallbackFactory;
import cn.etynit.domain.Activity;
import cn.etynit.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@FeignClient(contextId = "activityService",value = "service-platform",path = "/activity",fallbackFactory = ActivityServiceFallbackFactory.class)
public interface ActivityService {
    @RequestMapping(value = "/findByTitle/{title}",method = RequestMethod.GET)
    JsonResult findByTitle(@PathVariable("title")String title);

    @RequestMapping(value="/save",method= RequestMethod.POST)
    JsonResult saveOrUpdate(@RequestBody Activity activity);

    @RequestMapping(value = "/list",method = RequestMethod.GET)
    JsonResult list();
}
